Release 10.1A: OpenEdge Development:
Progress 4GL Reference
DEFINE IMAGE statement
(Windows only; Graphical interfaces only)Defines a static image widget in a graphical interface for use in the current procedure. An image widget is a container for an operating system image file and can be displayed in a form or used as a form background.
Note: Does not apply to SpeedScript programming.Syntax
[ PRIVATE ] IMAGEimage-nameDefines and identifies an image widget as a data member for a class, and optionally specifies an access mode for that data member. Do not specify the access mode when defining an image widget for a method within a class.
PRIVATE data members can be accessed only by the defining class. The default access mode is PRIVATE.
Note: This option is applicable only when defining a data member for a class in a class definition (.cls) file.IMAGEimage-nameIdentifies the name by which the image widget is referenced. You can define the image widget in a procedure or a method within a class.
image-phraseSpecifies the file where the image is stored and the portion of the image to read. This is the syntax for image-phrase:
For more information on this syntax, see the Image phrase reference entry.
You must specify either the LIKE option, an Image phrase or a Size phrase within the DEFINE IMAGE statement, and you may specify any two or all three.
LIKEimageSpecifies a previously defined image from which this image inherits attributes. You can override specific attributes by specifying other options of the DEFINE IMAGE statement.
You must specify either the LIKE option, an Image phrase or a Size phrase within the DEFINE IMAGE statement, and you may specify any two or all three.
size-phraseSpecifies the outside dimensions of the image widget. This is the syntax for size-phrase:
If you specify SIZE or SIZE-CHARS, the units are characters; if you specify SIZE-PIXELS, the units are pixels. If you use character units, the values
widthandheightmust be decimal constants; for pixel units, they must be integer constants. For more information, see the SIZE phrase reference entry.You must specify either the LIKE option, an Image phrase or a Size phrase within the DEFINE IMAGE statement, and you may specify any two or all three.
BGCOLORexpressionHas no effect; supported only for backward compatibility.
FGCOLORexpressionHas no effect; supported only for backward compatibility.
CONVERT-3D-COLORSSpecifies that the colors associated with an image will be converted to the system 3D colors when an image is loaded. Table 25 describes the color conversion process.
During a session, if Windows notifies Progress that the system colors are changed, all images that have this option are reloaded and converted to the new system colors.
TOOLTIPtooltipAllows you to define a help text message for an image widget. Progress automatically displays this text when the user pauses the mouse pointer over the image widget.
You can add or change the TOOLTIP option at any time. If TOOLTIP is set to "" or the Unknown value (
?), then the ToolTip is removed from the button. No ToolTip is the default. ToolTips are supported in Windows only.STRETCH-TO-FITForces the image to expand or contract to fit within the image widget’s boundaries.
This option has no effect if an icon is displayed on the image widget.
RETAIN-SHAPEIndicates that the image should retain its aspect ratio (expand or contract equally in both dimensions). This may leave some uncovered space at the bottom or right of the image widget.
RETAIN-SHAPE is ignored if STRETCH-TO-FIT is FALSE or if an icon is displayed on the image widget.
TRANSPARENTIndicates that the background color of the image is transparent. The background color is determined by the color of the pixel in the lower left corner of the image.
The TRANSPARENT option overrides the CONVERT-3D-COLORS option; if both are set, CONVERT-3D-COLORS is ignored.
This option has no effect if an icon is displayed on the image widget.
ExampleThis procedure defines an image widget named
trashcan, and loads into the widget a series of operating system image files that create an animation of a fire burning in a trash can. The user begins the animation by choosing the Animate button. The procedure depends on the existence of image filenamesANI01,ANI02. ...ANI14.
Notes
- In Windows, if the file has no extension, Progress by default looks for image files with either a
.bmpor.icoextension.- To create the static image you are defining, you must define a static frame that contains the image. Each frame you define that contains the same image creates an additional instance of that image. The widget handle for a static image is not available until the image is created.
- Progress only performs the color conversion process on bitmaps (
.bmpfiles) that contain 256 or fewer colors. However, you might consider using 16-color bitmaps because only the first sixteen entries in the bitmap’s color table will be converted.- Icon colors (
.icofiles) are not converted, even if CONVERT-3D-COLORS is TRUE.- See Image phrase for the list of supported image file formats.
- You can specify an application-defined widget ID for a static image using the
form-itemphrase in either the FORM statement or the DEFINE FRAME statement. See the FORM statement and DEFINE FRAME statement reference entries for more information.See also
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |